#include <iostream>

using std::cout;
using std::endl;

void test()
{
    int a = 10;
    cout << "a = " << a << endl;
    //捕获列表
    //mutable是可修改的含义，可以去掉默认的const属性
    [a](int value)mutable->void{
        //函数体
        ++a;
        ++value;
        cout << "a = " << a << endl;
        cout << "value = " << value << endl;
    }(200);

    cout << "a = " << a << endl;
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

